<?php

class Plugin_Helper_String
{
	public function createRandom($length = 8, $type = 1)
	{
		$string = 'abcdefghiklmnopqstvzyzABCDEFGHIKLMNOPQSZTY01234567890';

		$max = strlen($string) - 1;
		$ret = '';
		for ($i = 0; $i < 8; ++$i)
		{
			$ret .= substr($string, mt_rand(0, $max), 1);
		}
		return $ret;

	}

	/**
	 * create hash.
	 */
	public function createHash()
	{
		return md5(implode(';',func_get_args()),0);
	}

}
